//
//  FuWuChengNuo.swift
//  RoundCatPlay2
//
//  Created by 姜澎 on 2019/10/30.
//  Copyright © 2019 jiangpeng. All rights reserved.
//

import UIKit

class FuWuChengNuo: UIView {
    
    private lazy var centerPeiWan: UIImageView = {
        let i = UIImageView()
        i.image = UIImage(named: "陪玩")
        i.contentMode = .scaleToFill
        return i
    }()
    
    private lazy var LeftWeiXin: UIImageView = {
        let i = UIImageView()
        i.image = UIImage(named: "微信")
        i.contentMode = .scaleToFill
        return i
    }()
    
    private lazy var touSu: UIImageView = {
        let i = UIImageView()
        i.image = UIImage(named: "投诉")
        i.contentMode = .scaleToFill
        return i
    }()
    
    private lazy var weiXinLable : UILabel = {
        let i  = UILabel()
        i.text = "秒加微信"
        i.font = UIFont.systemFont(ofSize: 14)
        i.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        return i
    }()
    
    private lazy var PeiWanLable : UILabel = {
        let i  = UILabel()
        i.text = "在线陪玩"
        i.font = UIFont.systemFont(ofSize: 14)
        i.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        return i
    }()
    
    private lazy var TouSuLable: UILabel = {
        let i  = UILabel()
        i.text = "不爽投诉"
        i.font = UIFont.systemFont(ofSize: 14)
        i.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        return i
    }()
    
    private lazy var contetnOne: UILabel = {
        let i = UILabel()
        i.text = "1/成功支付后，在陪玩师接单之前可以取消订单"
        i.font = UIFont.systemFont(ofSize: 14)
        i.numberOfLines = 0
        i.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        return i
    }()
    
    
    private lazy var contetnTwo: UILabel = {
        let i = UILabel()
        i.text = "2/服务和描述不一致，投诉即可全额退款"
        i.font = UIFont.systemFont(ofSize: 14)
        i.numberOfLines = 0
        i.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        return i
    }()
    
    private lazy var contetnThree: UILabel = {
        let i = UILabel()
        i.text = "3/支付下单成功后，默认同意《圆猫陪玩用户守则》"
        i.font = UIFont.systemFont(ofSize: 14)
        i.numberOfLines = 0
        i.textColor = UIColor(red: 151.0 / 255.0, green: 151.0 / 255.0, blue: 151.0 / 255.0, alpha: 1.0)
        return i
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

extension FuWuChengNuo {
    func setUI() {
        
        addSubview(centerPeiWan)
        addSubview(LeftWeiXin)
        addSubview(touSu)
        
        addSubview(weiXinLable)
        addSubview(TouSuLable)
        addSubview(PeiWanLable)
        
        addSubview(contetnOne)
        addSubview(contetnTwo)
        addSubview(contetnThree)
        
        setCenterImFrame()
        setLeftWeiXinFrame()
        setTouSuFrame()
        
        setPeiWanLableFrame()
        setTouSuLableFrame()
        setWeiXinLableFrame()
        
        one()
        two()
        three()
    }
    
    func setCenterImFrame() {
        self.centerPeiWan.snp.makeConstraints { (make) in
            make.top.equalTo(10)
            make.centerX.equalTo(self.snp_centerX)
            make.width.equalTo(50)
            make.height.equalTo(50)
            make.bottom.equalTo(PeiWanLable.snp_top).offset(-8)
        }
    }
    
    func setLeftWeiXinFrame() {
        self.LeftWeiXin.snp.makeConstraints { (make) in
            make.top.equalTo(10)
            make.width.equalTo(50)
            make.height.equalTo(50)
            make.centerX.equalTo(self.snp_centerX).multipliedBy(0.5).offset(-10)
        }
    }
    
    func setTouSuFrame() {
        self.touSu.snp.makeConstraints { (make) in
            make.top.equalTo(10)
            make.width.equalTo(50)
            make.height.equalTo(50)
            make.centerX.equalTo(self.snp_centerX).multipliedBy(1.5).offset(10)
        }
    }
    
    func setPeiWanLableFrame() {
        self.PeiWanLable.snp.makeConstraints { (make) in
            make.centerX.equalTo(self.centerPeiWan.snp_centerX)
            make.bottom.equalTo(self.contetnOne.snp_top).offset(-25)
        }
    }
    
    func setWeiXinLableFrame() {
        self.weiXinLable.snp.makeConstraints { (make) in
            make.centerX.equalTo(self.LeftWeiXin.snp_centerX)
            make.bottom.equalTo(PeiWanLable.snp_bottom)
        }
    }
    
    func setTouSuLableFrame() {
        self.TouSuLable.snp.makeConstraints { (make) in
            make.centerX.equalTo(self.touSu.snp_centerX)
            make.bottom.equalTo(PeiWanLable.snp_bottom)
        }
    }
    
    func one() {
        self.contetnOne.snp.makeConstraints { (make) in
            make.left.equalTo(23)
            make.bottom.equalTo(self.contetnTwo.snp_top).offset(-15)
            make.right.equalTo(-10)
        }
    }
    
    func two() {
        self.contetnTwo.snp.makeConstraints { (make) in
            make.left.equalTo(23)
            make.bottom.equalTo(self.contetnThree.snp_top).offset(-15)
            make.right.equalTo(-10)
        }
    }
    
    func three() {
        self.contetnThree.snp.makeConstraints { (make) in
            make.left.equalTo(23)
            make.bottom.equalTo(-10)
            make.right.equalTo(-10)
        }
    }
}
